import { HTTP } from "../utils/http.js"
class FriendModel extends HTTP {
  addFriend(userid,_callback) {
    let data = { "UID": userid }
    this.request({
      url: "/usr/addFriend",
      method:"POST",
      data:data,
      success: function (data) {
        console.log(data);
        _callback(data);
      }
    })
  }
  searchFriends(params,_callback){
    this.request({
      url: "/usr/searchFriend",
      method: "POST",
      data: params,
      success: function (data) {
        _callback(data)
      }
    })
  }
  getRecommendFriends(_callback){
    this.request({
      url: "/usr/getRecommendFriends",
      method: "POST",
      success: function (data) {
        _callback(data);
      }
    })
  }

  getFriendList(pagenation,_callback){
    this.request({
      url: "/usr/friendList?pageSize=" + pagenation.pageSize+"&pageNum="+pagenation.pageNum,
      method: "POST",
      success: function (data) {
        _callback(data);
      }
    })
  }
}

export { FriendModel }